<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/radio_group/form_field_radio_group_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer_positive/form_field_integer_positive_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class Menu_Item_Normal_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_url_value = $form->get_field('url_value');
		$f_url_value_view = new Form_Field_Text_View($form->get_name().'_'.$f_url_value->get_name(), $f_url_value);
		$this->add_field_view('url_value', $f_url_value_view);

		$f_label = $form->get_field('label');
		$f_label_view = new Form_Field_Text_View($form->get_name().'_'.$f_label->get_name(), $f_label);
		$this->add_field_view('label', $f_label_view);

		$f_ordering = $form->get_field('ordering');
		$f_ordering_view = new Form_Field_Integer_Positive_View($form->get_name().'_'.$f_ordering->get_name(), $f_ordering);
		$this->add_field_view('ordering', $f_ordering_view);

		$f_nofollow = $form->get_field('nofollow');
		$f_nofollow_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_nofollow->get_name(), $f_nofollow);
		$this->add_field_view('nofollow', $f_nofollow_view);

		$f_new_window = $form->get_field('new_window');
		$f_new_window_view = new Form_Field_Radio_Group_View($form->get_name().'_'.$f_new_window->get_name(), $f_new_window);
		$this->add_field_view('new_window', $f_new_window_view);

		$f_additional = $form->get_field('additional');
		$f_additional_view = new Form_Field_Text_View($form->get_name().'_'.$f_additional->get_name(), $f_additional);
		$this->add_field_view('additional', $f_additional_view);
	}
}